package com.ruoyi.business.service.impl;

import com.ruoyi.business.domain.WmsInPlanDetail;
import com.ruoyi.business.mapper.WmsInPlanDetailMapper;
import com.ruoyi.business.service.IWmsInPlanDetailService;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 入库计划明细Service业务层处理
 * 
 * @author sz
 * @date 2024-01-08
 */
@Service
public class WmsInPlanDetailServiceImpl implements IWmsInPlanDetailService
{
    @Autowired
    private WmsInPlanDetailMapper wmsInPlanDetailMapper;

    /**
     * 查询入库计划明细
     * 
     * @param id 入库计划明细ID
     * @return 入库计划明细
     */
    @Override
    public WmsInPlanDetail selectWmsInPlanDetailById(Long id)
    {
        return wmsInPlanDetailMapper.selectWmsInPlanDetailById(id);
    }

    /**
     * 查询入库计划明细列表
     * 
     * @param wmsInPlanDetail 入库计划明细
     * @return 入库计划明细
     */
    @Override
    public List<WmsInPlanDetail> selectWmsInPlanDetailList(WmsInPlanDetail wmsInPlanDetail)
    {
        return wmsInPlanDetailMapper.selectWmsInPlanDetailList(wmsInPlanDetail);
    }

    /**
     * 新增入库计划明细
     * 
     * @param wmsInPlanDetail 入库计划明细
     * @return 结果
     */
    @Override
    public int insertWmsInPlanDetail(WmsInPlanDetail wmsInPlanDetail)
    {
        wmsInPlanDetail.setCreateTime(DateUtils.getNowDate());
        return wmsInPlanDetailMapper.insertWmsInPlanDetail(wmsInPlanDetail);
    }

    /**
     * 修改入库计划明细
     * 
     * @param wmsInPlanDetail 入库计划明细
     * @return 结果
     */
    @Override
    public int updateWmsInPlanDetail(WmsInPlanDetail wmsInPlanDetail)
    {
        wmsInPlanDetail.setUpdateTime(DateUtils.getNowDate());
        return wmsInPlanDetailMapper.updateWmsInPlanDetail(wmsInPlanDetail);
    }

    /**
     * 删除入库计划明细对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWmsInPlanDetailByIds(String ids)
    {
        return wmsInPlanDetailMapper.deleteWmsInPlanDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除入库计划明细信息
     * 
     * @param id 入库计划明细ID
     * @return 结果
     */
    @Override
    public int deleteWmsInPlanDetailById(Long id)
    {
        return wmsInPlanDetailMapper.deleteWmsInPlanDetailById(id);
    }
}
